<template>
    <el-menu 
    :default-active="activeIndex" 
    class="el-menu-demo" 
    mode="horizontal" 
    background-color="#545c64"
    text-color="#fff" 
    @select="handleSelect">
        <el-menu-item index="1">Processing Center</el-menu-item>
        
        <el-sub-menu index="2">
            <template #title>Workspace</template>
            <el-menu-item index="2-1" hide-on-cl>
                <div class="slider-demo-block">
                    <span class="demonstration">nc: {{ nc }}</span>
                    <el-slider v-model="nc" :step="coefStep" max="2" />
                </div>
            </el-menu-item>
        </el-sub-menu>
        <!--
        <el-dropdown hide-on-click="false">
            <span class="el-dropdown-link">
                Dropdown List<el-icon><arrow-down /></el-icon>
            </span>
            <template #dropdown>
                <el-dropdown-menu>
                    <el-dropdown-item>
                        <container class="slider-demo-block">
                            <span class="demonstration">nc: {{ nc }}</span>
                            <el-slider v-model="nc" :step="coefStep" max="2" />
                        </container>
                    </el-dropdown-item>
                </el-dropdown-menu>
            </template>
        </el-dropdown>
        -->
        <el-menu-item index="3">Info</el-menu-item>
        <el-menu-item index="4">Orders</el-menu-item>
    </el-menu>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import { useGridStore } from '@/stores';

const gridStore = useGridStore()
const nc = ref(1)
const rc = ref(1)
const dc = ref(1)
const coefStep = 0.05

const activeIndex = ref('1')
const handleSelect = (key: string, keyPath: string[]) => {
    console.log(key, keyPath)
}
</script>

<style>
.el-menu--horizontal>.el-menu-item:nth-child(1) {
    margin-right: auto;
}

.slider-demo-block {
    width: 90%;
    display: flex;
    align-items: center;
    border: 2px solid #343499;
}
</style>
